package com.tcd.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tcd.pojo.Permission;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 权限表 Mapper 接口
 * </p>
 *
 * @author space
 * @since 2021-05-21
 */
public interface PermissionMapper extends BaseMapper<Permission> {
    List<Permission> selectUserPermission(Integer uid);

    List<Permission> selectPermissionFilter(@Param("pageIndex") Integer pageIndex,@Param("pageSize")  Integer pageSize,@Param("name")  String name,@Param("levels")  Integer[] levels,@Param("parentId")  Integer parentId);

    Integer selectPermissionFilterCount(@Param("name") String name,@Param("levels") Integer level,@Param("parentId") Integer parentId);

    List<Permission> selectPermissionByLevels(@Param("levels") Integer[] levels);

    Permission selectParentPermission(Integer parentId);

    List<Permission> selectChildrenPermission(Integer permissionId);

    List<Permission> selectRolePermission(Integer roleId);

}
